package Telephone;

import java.util.ArrayList;

public class Telephone 
{		
	
	//try some svn
		private String model;
		private String company;
		private int price;
		private String owner;
		private Battery battery;
		private Diplay display;
		
		private final ArrayList<Call> calls = new ArrayList<Call>();
		
		private static Telephone nokiaN95 = new Telephone("N95", "Nokia", 100, "someone", new Battery("B9505", 72, 4), new Diplay(12, 15000));
		
		public Telephone(String model, String company, int price, String owner, Battery battery, Diplay display) {
			this.model = model;
			this.company = company;
			this.price = price;
			this.owner = owner;
			this.battery = battery;
			this.display = display;
		}

		public static void getNokiaN95()
		{
			System.out.println();
			System.out.println(nokiaN95.model);
			System.out.println(nokiaN95.company);
			System.out.println(nokiaN95.price);
			System.out.println(nokiaN95.owner);
			System.out.println(nokiaN95.battery.getModel());
			System.out.println(nokiaN95.battery.getHoursTalk());
			System.out.println("colors: " + nokiaN95.display.getColors());
			System.out.println();
		}
		
		public String toString()
		{
			return "\n" + this.model + "\n" + this.company + "\n" + this.price + "\n" + this.owner + "\n" + this.battery.getModel() 
					+ "\n" + this.battery.getHoursTalk() + "\n" + this.display.getColors() + "\n"; 
			
		}
		
		public void makeCall (Call call)
		{
			calls.add(call);
		}
		
		public void callHistory()
		{
			if(calls.isEmpty())
			{
				System.out.println("EMPTY");
			}
			else
			{
				for(int i = 0; i < this.calls.size(); i++)
				{
					System.out.println(calls.toString());
				}
			}
		}
		
}
